/**
 * 文件名：OrderState.java
 *
 * 创建人：Fyh - 1009173473@qq.com
 *
 * 创建时间：2020年9月22日 上午9:18:23
 *
 * 版权所有：南京植百汇智能科技服务有限公司
 */
package com.z100h.supplychain.order.enums;

/**
 * [描述信息：说明类的基本功能]
 *
 * @author Fyh - 1009173473@qq.com
 * @version 1.0 Created on 2020年9月22日 上午9:18:23
 */
public enum OrderApprovalState {

	WAITTING("待下单", "4"), MAKEREQUEST("发起申请", "0"), PENDING("待审批", "1"), APPROVED("审批通过", "2"), REJECTED("审批拒绝",
			"3"), WITHDRAWN("已撤销", "5");

	private String name;

	private String type;

	private OrderApprovalState(String name, String type) {
		this.name = name;
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public static OrderApprovalState get(String orderState) {
		switch (orderState) {
			case "4":
				return WAITTING;
			case "0":
				return MAKEREQUEST;
			case "1":
				return PENDING;
			case "2":
				return APPROVED;
			case "3":
				return REJECTED;
			default:
				return WITHDRAWN;
		}
	}

	public static boolean isWatting(String orderState) {
		switch (orderState) {
			case "4":
				return true;
			default:
				return false;
		}
	}

}
